import Types from '../actionTypes';

let initState = {
  current: 1,
  pageCount: '', // 总数量
  goodsListData: [] // 数据列表
};

export default (state = initState, action) => {
  const newState = JSON.parse(JSON.stringify(state));
  switch (action.type) {
    case Types.GET_GOODSLIBRARY_INFO:
      newState.goodsListData = action.data.data;
      newState.pageCount = action.data.pageCount;
      newState.current = +action.data.page;
      return newState;
    default:
      console.log('Types no match in goodsLibrary.js ....');
  }
  return state;
}
